import React, { lazy, Suspense } from 'react';

const LazyLoad = (path) => {
  const Component = lazy(() => import(`../views/${path}`));
  return (
    <Suspense fallback={<>加载中...</>}>
      <Component />
    </Suspense>
  );
};

export default LazyLoad;
